import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/base_entity.dart';

BaseEntity $BaseEntityFromJson(Map<String, dynamic> json) {
  final BaseEntity baseEntity = BaseEntity();
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    baseEntity.msg = msg;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    baseEntity.code = code;
  }
  return baseEntity;
}

Map<String, dynamic> $BaseEntityToJson(BaseEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msg'] = entity.msg;
  data['code'] = entity.code;
  return data;
}

extension BaseEntityExtension on BaseEntity {
  BaseEntity copyWith({
    String? msg,
    int? code,
  }) {
    return BaseEntity()
      ..msg = msg ?? this.msg
      ..code = code ?? this.code;
  }
}